package com.zy.chapter5

import com.zy.chapter6.Account

/**
 * @description: ${description}
 * @author: zhaoyi
 * @create: 2020-04-23 22:21
 **/
object Test {

  def main(args: Array[String]): Unit = {

    val count = new Count()
    count.increment()
    println(count.current)
    println(count.value2)

    val person = new Person()

    //调用的age_=方法，相当于java的setXX方法
    person.age = 10
    println(person.age)

    new Ts()

    val java = new BeanJava()
    println(java.getName)
    java.setName("ls")
    println(java.getName)

    val bb = new PersonJava("zs",16,false,"bj")
    println(bb.name)
    println(bb.getSex)

    println(bb.myAddress)
    println(bb.other)

    //无法访问
    //println(bb.address)
    //println(bb.age)

    val cc = new PersonJava("辅助构造器")
    println(cc.name)
    println(cc.other)

    //主构造器被私有化了
    new PrivateConstructor("bj",18,false)



  }

}
